export const taskTypeObj = {}
export const taskTypeList = [
  {
    label: '重启',
    value: '1'
  },
  {
    label: '部署',
    value: '2',
    disable: true
  },
  {
    label: '升级应用',
    value: '3',
    disable: true
  },
  {
    label: '升级驱动',
    value: '4'
  }
]

taskTypeList.forEach(item => {
  taskTypeObj[item.value] = item.label
})

export const taskStatusObj = {}
export const taskStatus = [
  {
    label: '全部',
    value: ''
  },
  {
    label: '待开始',
    value: '1'
  },
  {
    label: '执行中',
    value: '2'
  },
  {
    label: '准备就绪',
    value: '3'
  },
  {
    label: '已完成',
    value: '4'
  },
  {
    label: '失效',
    value: '5'
  },
  {
    label: '已关闭',
    value: '6'
  },
  {
    label: '到有效期未执行',
    value: '7'
  },
  {
    label: '等待中',
    value: '8'
  }
]
taskStatus.forEach(item => {
  taskStatusObj[item.value] = item.label
})

export const cycleObj = {}
export const cycleList = [
  {
    label: '单次',
    value: '1'
  },
  {
    label: '每月',
    value: '2'
  },
  {
    label: '每年',
    value: '5'
  }
]
cycleList.forEach(item => {
  cycleObj[item.value] = item.label
})

export const execStatusList = [
  {
    label: '全部',
    value: ''
  },
  {
    label: '成功',
    value: '1'
  },
  {
    label: '失败',
    value: '2'
  }
]

export const errorReasonObj = {}
export const errorReasonList = [
  {
    label: '设备不在线',
    value: 1
  },
  {
    label: '系统错误',
    value: 2
  },
  {
    label: '部署失败',
    value: 3
  },
  {
    label: '部署超时',
    value: 4
  },
  {
    label: '一直处于部署中',
    value: 5
  },
  {
    label: '部署任务初始化',
    value: 6
  },
  {
    label: '到达有效期，未执行',
    value: 7
  }
]

errorReasonList.forEach(item => {
  errorReasonObj[item.value] = item.label
})
